// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function subclass_select_blocker() {
  var sc1 = $('subclass1').checked;
  var sc2 = $('subclass2').checked;
  var sc3 = $('subclass3').checked;
  var sc4 = $('subclass4').checked;
  
  if (sc1 || sc2 || sc3) {
  	$('subclass4').disabled = true;
  } else {
  	$('subclass4').disabled = false;
  }
  
  if (sc4) {
  	$('subclass1').disabled = true;
	$('subclass2').disabled = true;
	$('subclass3').disabled = true;
  } else {
  	$('subclass1').disabled = false;
	$('subclass2').disabled = false;
	$('subclass3').disabled = false;
  }
}

function activate_submenu(id) {
  for (var i = 0; i <=4; i++) {
  	$('subclass' + i).removeClassName('selected');
  }
  
  $('subclass' + id).addClassName('selected');
}
